3.13.69 \(\int \frac {x^2 (a+b \arctan (c x))^2}{(d+e x^2)^2} \, dx\) [1269]

3.13.69.1 Optimal result
3.13.69.2 Mathematica [F]
3.13.69.3 Rubi [A] (verified)
3.13.69.4 Maple [C] (warning: unable to verify)
3.13.69.5 Fricas [F]
3.13.69.6 Sympy [F(-1)]
3.13.69.7 Maxima [F(-2)]
3.13.69.8 Giac [F]
3.13.69.9 Mupad [F(-1)]

3.13.69.1 Optimal result

Integrand size = 23, antiderivative size = 1033 \[ \int \frac {x^2 (a+b \arctan (c x))^2}{\left (d+e x^2\right )^2} \, dx=-\frac {i c (a+b \arctan (c x))^2}{2 \left (c^2 d-e\right ) e}+\frac {(a+b \arctan (c x))^2}{4 e^{3/2} \left (\sqrt {-d}-\sqrt {e} x\right )}-\frac {(a+b \arctan (c x))^2}{4 e^{3/2} \left (\sqrt {-d}+\sqrt {e} x\right )}+\frac {b c (a+b \arctan (c x)) \log \left (\frac {2}{1-i c x}\right )}{\left (c^2 d-e\right ) e}-\frac {b c (a+b \arctan (c x)) \log \left (\frac {2}{1+i c x}\right )}{\left (c^2 d-e\right ) e}-\frac {b c (a+b \arctan (c x)) \log \left (\frac {2 c \left (\sqrt {-d}-\sqrt {e} x\right )}{\left (c \sqrt {-d}-i \sqrt {e}\right ) (1-i c x)}\right )}{2 \left (c^2 d-e\right ) e}+\frac {(a+b \arctan (c x))^2 \log \left (\frac {2 c \left (\sqrt {-d}-\sqrt {e} x\right )}{\left (c \sqrt {-d}-i \sqrt {e}\right ) (1-i c x)}\right )}{4 \sqrt {-d} e^{3/2}}-\frac {b c (a+b \arctan (c x)) \log \left (\frac {2 c \left (\sqrt {-d}+\sqrt {e} x\right )}{\left (c \sqrt {-d}+i \sqrt {e}\right ) (1-i c x)}\right )}{2 \left (c^2 d-e\right ) e}-\frac {(a+b \arctan (c x))^2 \log \left (\frac {2 c \left (\sqrt {-d}+\sqrt {e} x\right )}{\left (c \sqrt {-d}+i \sqrt {e}\right ) (1-i c x)}\right )}{4 \sqrt {-d} e^{3/2}}-\frac {i b^2 c \operatorname {PolyLog}\left (2,1-\frac {2}{1-i c x}\right )}{2 \left (c^2 d-e\right ) e}-\frac {i b^2 c \operatorname {PolyLog}\left (2,1-\frac {2}{1+i c x}\right )}{2 \left (c^2 d-e\right ) e}+\frac {i b^2 c \operatorname {PolyLog}\left (2,1-\frac {2 c \left (\sqrt {-d}-\sqrt {e} x\right )}{\left (c \sqrt {-d}-i \sqrt {e}\right ) (1-i c x)}\right )}{4 \left (c^2 d-e\right ) e}-\frac {i b (a+b \arctan (c x)) \operatorname {PolyLog}\left (2,1-\frac {2 c \left (\sqrt {-d}-\sqrt {e} x\right )}{\left (c \sqrt {-d}-i \sqrt {e}\right ) (1-i c x)}\right )}{4 \sqrt {-d} e^{3/2}}+\frac {i b^2 c \operatorname {PolyLog}\left (2,1-\frac {2 c \left (\sqrt {-d}+\sqrt {e} x\right )}{\left (c \sqrt {-d}+i \sqrt {e}\right ) (1-i c x)}\right )}{4 \left (c^2 d-e\right ) e}+\frac {i b (a+b \arctan (c x)) \operatorname {PolyLog}\left (2,1-\frac {2 c \left (\sqrt {-d}+\sqrt {e} x\right )}{\left (c \sqrt {-d}+i \sqrt {e}\right ) (1-i c x)}\right )}{4 \sqrt {-d} e^{3/2}}+\frac {b^2 \operatorname {PolyLog}\left (3,1-\frac {2 c \left (\sqrt {-d}-\sqrt {e} x\right )}{\left (c \sqrt {-d}-i \sqrt {e}\right ) (1-i c x)}\right )}{8 \sqrt {-d} e^{3/2}}-\frac {b^2 \operatorname {PolyLog}\left (3,1-\frac {2 c \left (\sqrt {-d}+\sqrt {e} x\right )}{\left (c \sqrt {-d}+i \sqrt {e}\right ) (1-i c x)}\right )}{8 \sqrt {-d} e^{3/2}} \]

output
1/4*I*b^2*c*polylog(2,1-2*c*((-d)^(1/2)-x*e^(1/2))/(1-I*c*x)/(c*(-d)^(1/2) 
-I*e^(1/2)))/(c^2*d-e)/e+b*c*(a+b*arctan(c*x))*ln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1/2)-1/8*b^2*polylog(3,1-2*c*((-d)^(1/2)+x*e^(1/2))/(1-I*c* 
x)/(c*(-d)^(1/2)+I*e^(1/2)))/e^(3/2)/(-d)^(1/2)+1/4*(a+b*arctan(c*x))^2/e^ 
(3/2)/((-d)^(1/2)-x*e^(1/2))-1/4*(a+b*arctan(c*x))^2/e^(3/2)/((-d)^(1/2)+x 
*e^(1/2))
 
3.13.69.2 Mathematica [F]

\[ \int \frac {x^2 (a+b \arctan (c x))^2}{\left (d+e x^2\right )^2} \, dx=\int \frac {x^2 (a+b \arctan (c x))^2}{\left (d+e x^2\right )^2} \, dx \]

input
Integrate[(x^2*(a + b*ArcTan[c*x])^2)/(d + e*x^2)^2,x]
 
output
Integrate[(x^2*(a + b*ArcTan[c*x])^2)/(d + e*x^2)^2, x]
 
3.13.69.3 Rubi [A] (verified)

Time = 1.90 (sec) , antiderivative size = 1033, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.087, Rules used = {5515, 2009}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {x^2 (a+b \arctan (c x))^2}{\left (d+e x^2\right )^2} \, dx\)

\(\Big \downarrow \) 5515

\(\displaystyle \int \left (\frac {(a+b \arctan (c x))^2}{e \left (d+e x^2\right )}-\frac {d (a+b \arctan (c x))^2}{e \left (d+e x^2\right )^2}\right )dx\)

\(\Big \downarrow \) 2009

\(\displaystyle -\frac {i c \operatorname {PolyLog}\left (2,1-\frac {2}{1-i c x}\right ) b^2}{2 \left (c^2 d-e\right ) e}-\frac {i c \operatorname {PolyLog}\left (2,1-\frac {2}{i c x+1}\right ) b^2}{2 \left (c^2 d-e\right ) e}+\frac {i c \operatorname {PolyLog}\left (2,1-\frac {2 c \left (\sqrt {-d}-\sqrt {e} x\right )}{\left (c \sqrt {-d}-i \sqrt {e}\right ) (1-i c x)}\right ) b^2}{4 \left (c^2 d-e\right ) e}+\frac {i c \operatorname {PolyLog}\left (2,1-\frac {2 c \left (\sqrt {e} x+\sqrt {-d}\right )}{\left (\sqrt {-d} c+i \sqrt {e}\right ) (1-i c x)}\right ) b^2}{4 \left (c^2 d-e\right ) e}+\frac {\operatorname {PolyLog}\left (3,1-\frac {2 c \left (\sqrt {-d}-\sqrt {e} x\right )}{\left (c \sqrt {-d}-i \sqrt {e}\right ) (1-i c x)}\right ) b^2}{8 \sqrt {-d} e^{3/2}}-\frac {\operatorname {PolyLog}\left (3,1-\frac {2 c \left (\sqrt {e} x+\sqrt {-d}\right )}{\left (\sqrt {-d} c+i \sqrt {e}\right ) (1-i c x)}\right ) b^2}{8 \sqrt {-d} e^{3/2}}+\frac {c (a+b \arctan (c x)) \log \left (\frac {2}{1-i c x}\right ) b}{\left (c^2 d-e\right ) e}-\frac {c (a+b \arctan (c x)) \log \left (\frac {2}{i c x+1}\right ) b}{\left (c^2 d-e\right ) e}-\frac {c (a+b \arctan (c x)) \log \left (\frac {2 c \left (\sqrt {-d}-\sqrt {e} x\right )}{\left (c \sqrt {-d}-i \sqrt {e}\right ) (1-i c x)}\right ) b}{2 \left (c^2 d-e\right ) e}-\frac {c (a+b \arctan (c x)) \log \left (\frac {2 c \left (\sqrt {e} x+\sqrt {-d}\right )}{\left (\sqrt {-d} c+i \sqrt {e}\right ) (1-i c x)}\right ) b}{2 \left (c^2 d-e\right ) e}-\frac {i (a+b \arctan (c x)) \operatorname {PolyLog}\left (2,1-\frac {2 c \left (\sqrt {-d}-\sqrt {e} x\right )}{\left (c \sqrt {-d}-i \sqrt {e}\right ) (1-i c x)}\right ) b}{4 \sqrt {-d} e^{3/2}}+\frac {i (a+b \arctan (c x)) \operatorname {PolyLog}\left (2,1-\frac {2 c \left (\sqrt {e} x+\sqrt {-d}\right )}{\left (\sqrt {-d} c+i \sqrt {e}\right ) (1-i c x)}\right ) b}{4 \sqrt {-d} e^{3/2}}-\frac {i c (a+b \arctan (c x))^2}{2 \left (c^2 d-e\right ) e}+\frac {(a+b \arctan (c x))^2}{4 e^{3/2} \left (\sqrt {-d}-\sqrt {e} x\right )}-\frac {(a+b \arctan (c x))^2}{4 e^{3/2} \left (\sqrt {e} x+\sqrt {-d}\right )}+\frac {(a+b \arctan (c x))^2 \log \left (\frac {2 c \left (\sqrt {-d}-\sqrt {e} x\right )}{\left (c \sqrt {-d}-i \sqrt {e}\right ) (1-i c x)}\right )}{4 \sqrt {-d} e^{3/2}}-\frac {(a+b \arctan (c x))^2 \log \left (\frac {2 c \left (\sqrt {e} x+\sqrt {-d}\right )}{\left (\sqrt {-d} c+i \sqrt {e}\right ) (1-i c x)}\right )}{4 \sqrt {-d} e^{3/2}}\)

input
Int[(x^2*(a + b*ArcTan[c*x])^2)/(d + e*x^2)^2,x]
 
output
((-1/2*I)*c*(a + b*ArcTan[c*x])^2)/((c^2*d - e)*e) + (a + b*ArcTan[c*x])^2 
/(4*e^(3/2)*(Sqrt[-d] - Sqrt[e]*x)) - (a + b*ArcTan[c*x])^2/(4*e^(3/2)*(Sq 
rt[-d] + Sqrt[e]*x)) + (b*c*(a + b*ArcTan[c*x])*Log[2/(1 - I*c*x)])/((c^2* 
d - e)*e) - (b*c*(a + b*ArcTan[c*x])*Log[2/(1 + I*c*x)])/((c^2*d - e)*e) - 
 (b*c*(a + b*ArcTan[c*x])*Log[(2*c*(Sqrt[-d] - Sqrt[e]*x))/((c*Sqrt[-d] - 
I*Sqrt[e])*(1 - I*c*x))])/(2*(c^2*d - e)*e) + ((a + b*ArcTan[c*x])^2*Log[( 
2*c*(Sqrt[-d] - Sqrt[e]*x))/((c*Sqrt[-d] - I*Sqrt[e])*(1 - I*c*x))])/(4*Sq 
rt[-d]*e^(3/2)) - (b*c*(a + b*ArcTan[c*x])*Log[(2*c*(Sqrt[-d] + Sqrt[e]*x) 
)/((c*Sqrt[-d] + I*Sqrt[e])*(1 - I*c*x))])/(2*(c^2*d - e)*e) - ((a + b*Arc 
Tan[c*x])^2*Log[(2*c*(Sqrt[-d] + Sqrt[e]*x))/((c*Sqrt[-d] + I*Sqrt[e])*(1 
- I*c*x))])/(4*Sqrt[-d]*e^(3/2)) - ((I/2)*b^2*c*PolyLog[2, 1 - 2/(1 - I*c* 
x)])/((c^2*d - e)*e) - ((I/2)*b^2*c*PolyLog[2, 1 - 2/(1 + I*c*x)])/((c^2*d 
 - e)*e) + ((I/4)*b^2*c*PolyLog[2, 1 - (2*c*(Sqrt[-d] - Sqrt[e]*x))/((c*Sq 
rt[-d] - I*Sqrt[e])*(1 - I*c*x))])/((c^2*d - e)*e) - ((I/4)*b*(a + b*ArcTa 
n[c*x])*PolyLog[2, 1 - (2*c*(Sqrt[-d] - Sqrt[e]*x))/((c*Sqrt[-d] - I*Sqrt[ 
e])*(1 - I*c*x))])/(Sqrt[-d]*e^(3/2)) + ((I/4)*b^2*c*PolyLog[2, 1 - (2*c*( 
Sqrt[-d] + Sqrt[e]*x))/((c*Sqrt[-d] + I*Sqrt[e])*(1 - I*c*x))])/((c^2*d - 
e)*e) + ((I/4)*b*(a + b*ArcTan[c*x])*PolyLog[2, 1 - (2*c*(Sqrt[-d] + Sqrt[ 
e]*x))/((c*Sqrt[-d] + I*Sqrt[e])*(1 - I*c*x))])/(Sqrt[-d]*e^(3/2)) + (b^2* 
PolyLog[3, 1 - (2*c*(Sqrt[-d] - Sqrt[e]*x))/((c*Sqrt[-d] - I*Sqrt[e])*(...
 

3.13.69.3.1 Defintions of rubi rules used

rule 2009
Int[u_, x_Symbol] :> Simp[IntSum[u, x], x] /; SumQ[u]
 

rule 5515
Int[((a_.) + ArcTan[(c_.)*(x_)]*(b_.))^(p_.)*((f_.)*(x_))^(m_.)*((d_) + (e_ 
.)*(x_)^2)^(q_.), x_Symbol] :> With[{u = ExpandIntegrand[(a + b*ArcTan[c*x] 
)^p, (f*x)^m*(d + e*x^2)^q, x]}, Int[u, x] /; SumQ[u]] /; FreeQ[{a, b, c, d 
, e, f, m}, x] && IntegerQ[q] && IGtQ[p, 0] && ((EqQ[p, 1] && GtQ[q, 0]) || 
 IntegerQ[m])
 
3.13.69.4 Maple [C] (warning: unable to verify)

Result contains higher order function than in optimal. Order 9 vs. order 4.

Time = 157.17 (sec) , antiderivative size = 6565, normalized size of antiderivative = 6.36

method result size
parts \(\text {Expression too large to display}\) \(6565\)
derivativedivides \(\text {Expression too large to display}\) \(6636\)
default \(\text {Expression too large to display}\) \(6636\)

input
int(x^2*(a+b*arctan(c*x))^2/(e*x^2+d)^2,x,method=_RETURNVERBOSE)
 
output
result too large to display
 
3.13.69.5 Fricas [F]

\[ \int \frac {x^2 (a+b \arctan (c x))^2}{\left (d+e x^2\right )^2} \, dx=\int { \frac {{\left (b \arctan \left (c x\right ) + a\right )}^{2} x^{2}}{{\left (e x^{2} + d\right )}^{2}} \,d x } \]

input
integrate(x^2*(a+b*arctan(c*x))^2/(e*x^2+d)^2,x, algorithm="fricas")
 
output
integral((b^2*x^2*arctan(c*x)^2 + 2*a*b*x^2*arctan(c*x) + a^2*x^2)/(e^2*x^ 
4 + 2*d*e*x^2 + d^2), x)
 
3.13.69.6 Sympy [F(-1)]

Timed out. \[ \int \frac {x^2 (a+b \arctan (c x))^2}{\left (d+e x^2\right )^2} \, dx=\text {Timed out} \]

input
integrate(x**2*(a+b*atan(c*x))**2/(e*x**2+d)**2,x)
 
output
Timed out
 
3.13.69.7 Maxima [F(-2)]

Exception generated. \[ \int \frac {x^2 (a+b \arctan (c x))^2}{\left (d+e x^2\right )^2} \, dx=\text {Exception raised: ValueError} \]

input
integrate(x^2*(a+b*arctan(c*x))^2/(e*x^2+d)^2,x, algorithm="maxima")
 
output
Exception raised: ValueError >> Computation failed since Maxima requested 
additional constraints; using the 'assume' command before evaluation *may* 
 help (example of legal syntax is 'assume(e>0)', see `assume?` for more de 
tails)Is e
 
3.13.69.8 Giac [F]

\[ \int \frac {x^2 (a+b \arctan (c x))^2}{\left (d+e x^2\right )^2} \, dx=\int { \frac {{\left (b \arctan \left (c x\right ) + a\right )}^{2} x^{2}}{{\left (e x^{2} + d\right )}^{2}} \,d x } \]

input
integrate(x^2*(a+b*arctan(c*x))^2/(e*x^2+d)^2,x, algorithm="giac")
 
output
sage0*x
 
3.13.69.9 Mupad [F(-1)]

Timed out. \[ \int \frac {x^2 (a+b \arctan (c x))^2}{\left (d+e x^2\right )^2} \, dx=\int \frac {x^2\,{\left (a+b\,\mathrm {atan}\left (c\,x\right )\right )}^2}{{\left (e\,x^2+d\right )}^2} \,d x \]

input
int((x^2*(a + b*atan(c*x))^2)/(d + e*x^2)^2,x)
 
output
int((x^2*(a + b*atan(c*x))^2)/(d + e*x^2)^2, x)